package 分支;
import  java.util.Scanner;
public class 统计 {
    public static void main(String[] args) {
        int a = 0;
        int b = 0;
        int c = 0;
        int d = 0;

        System.out.println("输入字符串");
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        char[] ch =new char[s.length()] ;
        ch = s.toCharArray();
        for (int i = 0; i < ch.length; i++) {
            if (ch[i] >= '0' && ch[i] <= '9') {
                a++;
            } else if ((ch[i] >= 'a' && ch[i] <= 'z') || ch[i] > 'A' && ch[i] <= 'Z') {
                b++;
            } else if (ch[i] == ' ') {
                c++;
            } else {
                d++;
            }
        }
        System.out.println("数字的个数：" + a);
        System.out.println("英文字母个数：" + b);
        System.out.println("空格个数：" + c);
        System.out.println("其他字符个数：" + d);
    }
}
